function getNearbyTeams($ticketLng, $ticketLat)
    {
        // 地球半径，单位为公里
        $earthRadius = 6371;
        // 范围半径，单位为公里
        $distance = 100;

        // 将距离转换为弧度
        $distanceInRadians = $distance / $earthRadius;

        // 将经纬度转换为弧度
        $ticketLatRad = deg2rad($ticketLat);
        $ticketLngRad = deg2rad($ticketLng);

        // 计算最大和最小纬度
        $maxLat = $ticketLatRad + $distanceInRadians;
        $minLat = $ticketLatRad - $distanceInRadians;

        // 计算最大和最小经度
        $maxLng = $ticketLngRad + asin(sin($distanceInRadians) / cos($ticketLatRad));
        $minLng = $ticketLngRad - asin(sin($distanceInRadians) / cos($ticketLatRad));

        // 查询数据库
        $where = 'lat BETWEEN ' . rad2deg($minLat) . ' AND ' . rad2deg($maxLat) . ' AND lng BETWEEN ' . rad2deg($minLng) . ' AND ' . rad2deg($maxLng);
        $teams = Team::create()->where($where)
            ->all();

        // 过滤出距离在 100km 以内的队伍
        $nearbyTeams = [];
        foreach ($teams as $team) {
            $teamLatRad = deg2rad($team->lat);
            $teamLngRad = deg2rad($team->lng);

            $latDifference = $teamLatRad - $ticketLatRad;
            $lngDifference = $teamLngRad - $ticketLngRad;

            $a = sin($latDifference / 2) * sin($latDifference / 2) +
                cos($ticketLatRad) * cos($teamLatRad) *
                sin($lngDifference / 2) * sin($lngDifference / 2);

            $c = 2 * atan2(sqrt($a), sqrt(1 - $a));

            $calculatedDistance = $earthRadius * $c;
            if ($calculatedDistance <= $distance) {
                $teamArr = $team->toArray();
                $teamArr['distance'] = $calculatedDistance ? round($calculatedDistance, 2) : 0;
                $nearbyTeams[] = $teamArr;
            }
        }
        if ($nearbyTeams) {
            $sort = array_column($nearbyTeams, 'distance');
            array_multisort($sort, SORT_ASC, $nearbyTeams);
        }
        return $nearbyTeams;
    }